#include "mgame.h"
#include "ui_mgame.h"
#include<qrect.h>

Mgame::Mgame(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Mgame)
{
    ui->setupUi(this);
    this->setGeometry(QRect(520,660,520,660));
}

Mgame::~Mgame()
{
    delete ui;
}

//画图
void Mgame::paintEvent(QPaintEvent *event){
    QPainter painter(this);
    //主页背景
    //窗口边缘
    painter.setPen(Qt::black);//画笔颜色
    painter.setBrush(Qt::gray);//填充颜色
    painter.drawRect(10,10,500,640);//500*640界面，相对于框体的起点坐标（10,10）
    painter.drawPixmap(10,10,500,640,QPixmap("://image/images/1.jpg"));//背景图片
}


//链接

void Mgame::on_pushButton_clicked()
{
    this->hide();
            emit showmain();
}
